import request from '@/utils/request'

//审核通过
export function pass(id) {
  return request({
    url: '/business/business/pass/'+id,
    method: 'post'
  })
}

//审核未通过
export function noPass(id) {
  return request({
    url: '/business/business/noPass/'+id,
    method: 'post'
  })
}

//注册商户
export function registerBusiness(query) {
  return request({
    url: '/business/business/registerBusiness',
    method: 'post',
    data: query
  })
}

//获取城市
export function getCity() {
  return request({
    url: '/business/business/getCity',
    method: 'get',
  })
}

//获取短信
export function getMessage(phone) {
  return request({
    url: '/business/business/send/'+phone,
    method: 'get',
  })
}

//注册商户
export function register(query) {
  return request({
    url: '/business/business/register',
    method: 'post',
    data: query
  })
}

// 查询商户列表
export function listBusiness(query) {
  return request({
    url: '/business/business/list',
    method: 'get',
    params: query
  })
}

// 查询商户详细
export function getBusiness(id) {
  return request({
    url: '/business/business/getBusiness/' + id,
    method: 'get'
  })
}

// 新增商户
export function addBusiness(data) {
  return request({
    url: '/system/business',
    method: 'post',
    data: data
  })
}

// 修改商户
export function updateBusiness(data) {
  return request({
    url: '/system/business',
    method: 'put',
    data: data
  })
}

// 删除商户
export function delBusiness(id) {
  return request({
    url: '/system/business/' + id,
    method: 'delete'
  })
}

//获取注册人ip
export function getIp() {
  return request({
    url: '/business/business/getIp',
    method: 'get'
  })
}
